/*
 * @Author: 
 * @Date: 2025-09-16 16:01:08
 * @LastEditor: zhuxiaoyi
 * @LastEditTime: 2025-09-16 16:14:26
 * @Description: 
 */
import { Module } from '@nestjs/common';
import { TypeOrmModule } from '@nestjs/typeorm';
import { ConfigModule } from '@nestjs/config';
import { UsersModule } from './users/users.module';

@Module({
  imports: [
    ConfigModule.forRoot({
      isGlobal: true,
    }),
    TypeOrmModule.forRoot({
      type: 'postgres',
      host: process.env.DB_HOST,
      port: 5432,
      username: process.env.DB_USERNAME,
      password: process.env.DB_PASSWORD,
      database: process.env.DB_NAME,
      entities: [__dirname + '/**/*.entity{.ts,.js}'],
      synchronize: true, // 生产环境设为 false
    }),
    UsersModule,
  ],
})
export class AppModule {}